<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Select Level</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #main {
            width: 1400px;
            height: 1000px;
            background: url("img/index.png");
            margin: 20px auto;
            position: relative;
            overflow: hidden;
        }


        #stop {
            width: 400px;
            height: 700px;
            padding-top: 300px;
            position: absolute;
            z-index: 10;
            /* background-color: rgba(0, 0, 0, 0.6); */
            left: 50%;
            margin-left: -200px;
            top: 100px;
            display: block;
        }

        .button {
            width: 300px;
            height: 70px;
            color: #ffffff;
            background-color: rgba(0, 0, 0, 0.6);
            text-align: center;
            line-height: 50px;
            border-radius: 20px;
            font-size: 26px;
            font-weight: bolder;
            margin: 0 auto;
            margin-top: 10px;
            cursor: pointer;
        }

        .title {
            margin-top: 5%;
            margin-left: 39%;
            font-size: 50px;
            color: darkorange;
        }
        .button1 {
            margin-top: 150px;
           margin-left: 300px;
            background-color: grey;
            border: none;
            color: white;
            padding: 10px 20px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 16px;
            border-radius: 4px;
            cursor: pointer;
        }
    </style>
</head>

<body>
    <div id="main">
        <div class="button1" onclick="back()">返回主菜单</div>
        <h1 class="title">Select Level</h1>
        

        <div id="stop">
            <div class="button" onclick="first()">Level Ⅰ</div>
            <div class="button" onclick="third()">Level Ⅱ</div>
            <div class="button" onclick="three()">Level Ⅲ</div>
            <div class="button" onclick="fourth()">Level Ⅳ</div>
            <div class="button" onclick="five()">Level Ⅴ</div>
            <div class="button" onclick="surivical()">Survical</div>

        </div>

    </div>
    <script>
        // 最高分

        var grade = document.getElementById("grade");
        var data = localStorage.getItem('grade');
        // grade.textContent = data; 
        var d2 = localStorage.getItem('2');
        var d3 = localStorage.getItem('3');
        var d4 = localStorage.getItem('4');
        var d5 = localStorage.getItem('5');
        var d6 = localStorage.getItem('6');

        function first() {
            window.location.href = "plane.html";

        }
        function third() {
            if (d2 == "yes") {
                window.location.href = "plane2.html";

            } else {
                alert("请先通过前面的关卡");
            }

        }
        function three() {
            if (d3 == "yes") {
                window.location.href = "plane3.html";

            } else {
                alert("请先通过前面的关卡");
            }

        }
        function fourth() {
            if (d4 == "yes") {
                window.location.href = "plane4.html";

            } else {
                alert("请先通过前面的关卡");
            }

        }
        function five() {
            if (d5 == "yes") {
                window.location.href = "plane5.html";

            } else {
                alert("请先通过前面的关卡");
            }

        }

        function surivical() {
            if (d6 == "yes") {
                window.location.href = "survical.html";

            } else {
                alert("请先通过前面的关卡");
            }

        }
        function back() {
            window.location.href = "index.html";
        }





    </script>
</body>

</html>